<?php

namespace app\index\controller;

use think\Cache;
use think\Controller;
use think\Db;
use think\Loader;
use think\Request;
use think\Session;
use think\Validate;
use tree\Tree;

class Index extends Controller
{
    public function toastTest()
    {
        return $this->fetch();
    }

    public function select2()
    {
        return $this->fetch();
    }

    public function treeTest()
    {
        $obj = new Tree();
        $list = Db::name('menu')->field('id,pid,name')->select();
        $tree = $obj->getTreeData($list);
        echo "<pre>";
        print_r($tree);
        exit;

    }
}
